home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NBC Slam Jams!
/
NBC Slam Jams!.iso
/
coachsed.cst
/
00002_Script_moduleManager_Class
< prev
next >
Wrap
Text File
|
1999-06-17
|
2KB
|
81 lines
property moduleList
property currentModule
property openModuleList
property currentWindow
property playPak
property windowRectShape
on new me, PlayPakName, windowRect
global pDelim
set currentWindow = 0
set currentModule = 1
set playPak = playPakName
set playPakTitle = PlayPakName
set playPakDataPath = the pathname&playPakTitle&pDelim&"pak.dat"
set playPakData = readfile(playPakDataPath)
set the itemDelimiter = ":"
set playList = [:]
repeat with i = 1 to the number of lines in playPakData
if the number of chars in line i of playPakData > 4 then
addProp playList, item 1 of line i of playPakData, value(item 2 of line i of playPakData)
end if
end repeat
set moduleList = playList
set windowRectShape = windowRect
return me
end
on openApplet me, appletName
global webAuthoring
if voidP(appletName) then
set appletName = getFileName("?")
end if
if appletName <> "File not found" then
if NOT(currentWindow = 0) then
forget currentWindow
end if
set webAuthoring = FALSE
set the windowtype of window appletName to 490
set x1 = getAt(the rect of the stage,1) + getAt(the rect of sprite windowRectShape,1)
set y1 = getAt(the rect of the stage,2) + getAt(the rect of sprite windowRectShape,2)
set x2 = x1 + (the width of sprite windowRectShape)
set y2 = y1 + (the height of sprite windowRectShape)
set windowRect = rect(x1,y1,x2,y2)
set the rect of window appletName to windowRect
open window appletName
set currentWindow = getLast(the windowList)
end if
end
on closeApplet me
if NOT(currentWindow = 0) then
forget currentWindow
set currentWindow = 0
end if
end
on ShowCurrentModuleInfo me
set the text of field "PlayName" = getAt(GetAt(moduleList,currentModule),1)
set the text of field "PlayDescription" = getAt(GetAt(moduleList,currentModule),2)
end
on GoNextModule me
set currentModule = currentModule + 1
if currentModule > count(moduleList) then set currentModule = 1
showCurrentModuleInfo me
closeApplet me
end
on GoPreviousModule me
set currentModule = currentModule - 1
if currentModule = 0 then set currentModule = count(moduleList)
showCurrentModuleInfo me
closeApplet me
end
on openModule me
global pDelim
set currentModuleName = getPropAt(moduleList,currentModule)
openApplet(me, the pathName&playPak&pDelim¤tModuleName)
end